import request from '../../utils/request'


/**
 * 查询租户市场采购资源
 * @param code
 * @param name
 * @param page
 * @returns {Promise.<void>}
 */
export async function queryLesseeResource({code,name, page}) {

    return request(apiPath.authcenter + "/api/lesseeResource", {
        method: 'get',
        data: {code,name, page: page.page, size: page.size}
    });
}


/**
 * 非分页查询租户市场采购资源，主要用于下拉
 * @param code
 * @returns {Promise.<void>}
 */
export async function queryAllLesseeResource({code}) {
    return request(apiPath.authcenter + "/api/lesseeResource/all", {
        method: 'get',
        data: {code}
    });
}


/**
 * 获取单个租户市场采购资源
 * @param id
 * @returns {Promise.<void>}
 */
export async function getLesseeResource({id}) {

    return request(apiPath.authcenter + "/api/lesseeResource/" + id, {
        method: 'get'
    });
}


/**
 * 创建租户市场采购资源
 * @param data
 * @returns {Promise.<void>}
 */
export async function createLesseeResource(data) {
    return request(apiPath.authcenter + "/api/lesseeResource", {
        method: 'post',
        data
    });
}


/**
 * 更新租户市场采购资源
 * @param data
 * @returns {Promise.<void>}
 */
export async function updateLesseeResource( data ) {
    return request(apiPath.authcenter + "/api/lesseeResource", {
        method: 'put',
        data
    });
}


/**
 * 删除租户市场采购资源
 * @param id
 * @returns {Promise.<void>}
 */
export async function deleteLesseeResource({id}) {
    return request(apiPath.authcenter + "/api/lesseeResource/" + id , {
        method: 'delete'
    });
}
